<me:UIEXORD x:Class="WPFExcelReport.TEXORD"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                     xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
            xmlns:VKK="clr-namespace:WPFExcelReport;assembly=TICC_MAXORD" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                     x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIEXORD.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby1440  x:Key="day"/>
        <ucd:Divideby480  x:Key="shift"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIEXORD.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel  >
            <WrapPanel  Margin="10">


                <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=New Oder}}"></TextBlock>
                <Button Grid.Column="1" Height="30" Width="30" Margin="5,0,0,0"  Click="btnAddVKP_Click">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                    </Button.Background>
                </Button>

                <VKK:TMAXORD Name="cVK"
                    MAXORD="{Binding MAXORD,ElementName=TV}"
                              USD2RMB="{Binding USD2RMB,ElementName=TV}"
                              RATE1="{Binding RATE1,ElementName=TV}" 
                              />
                <TextBox Grid.Column="3" Name="txtNOrder" Width="40">1</TextBox>
                <TextBlock Margin="10,0,0,0" Grid.Column="4" Text="{Binding Source={Localization:Translate Word=User:}}"></TextBlock>
                <TextBox Grid.Column="5" Name="txtUser" Width="40">MVTV</TextBox>
                <Label Margin="10,0,0,0" Content="{Binding Source={Localization:Translate Word=Selection List1}}" VerticalContentAlignment="Center"></Label>
                <DR:TDRAUFTR Name="cDR1" Visibility="Collapsed"
                             DocType="AFSEXAPP1"   
                             PrintType="OpenExcel"
                             />
                <Button FontSize="18" Height="30" Width="30" Margin="5,0,0,0" Name="btnPrint1" Click="PrintCommand1" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Print.png" />
                    </Button.Background>
                </Button>
                <Label Margin="10,0,0,0" Content="{Binding Source={Localization:Translate Word=Selection List2}}" VerticalContentAlignment="Center"></Label>
                <DR:TDRAUFTR Name="cDR2" Visibility="Collapsed"
                        DocType="AFSEXAPP"  
                         PrintType="OpenExcel"
                         />
                <Button FontSize="18" Height="30" Width="30" Margin="5,0,0,0"  Click="PrintCommand2">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Print.png" />
                    </Button.Background>
                </Button>
                <Label Margin="10,0,0,0" Content="{Binding Source={Localization:Translate Word=Selection List3}}" VerticalContentAlignment="Center"></Label>
                <DR:TDRAUFTR Name="cDR3" Visibility="Collapsed"
                             DocType="AFSEXAPP3"   
                             PrintType="OpenExcel"
                             />
                <Button FontSize="18" Height="30" Width="30" Margin="5,0,0,0"   Click="PrintCommand3">
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Print.png" />
                    </Button.Background>
                </Button>
                <Grid  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=Current:}}"></TextBlock>
                    <TextBlock Grid.Column="1" Foreground="Red"  FontSize="18" Text="{Binding ROWNID }" ></TextBlock>
                </Grid>
            </WrapPanel>
            <WrapPanel  Margin="10">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock FontSize="18" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=Brand:   }}"></TextBlock>
                    <TextBox Grid.Column="1" FontSize="18" Text="{Binding VAR,ElementName=TV}" BorderBrush="Black" Width="300"></TextBox>
                </Grid>
                <WrapPanel Margin="30,0,0,0" >
                    <Grid  >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=Buyer Name:   }}" ></TextBlock>
                        <ex:TXT72 Grid.Column="1"   BorderBrush="Black" FontSize="18" IsAutoClear="True" Text="{Binding CHAR5}" Width="200" ></ex:TXT72>
                    </Grid>
                    <Grid Visibility="Collapsed"  >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=A/C:}}" ></TextBlock>
                        <TextBox Grid.Column="1"    BorderBrush="Black" FontSize="18"  Text="{Binding CHAR2}" Width="120" ></TextBox>
                    </Grid>
                    <Grid Visibility="Collapsed" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=Nation:}}" ></TextBlock>
                        <TextBox Grid.Column="1"   BorderBrush="Black" FontSize="18"  Text="{Binding CHAR3}" Width="120" ></TextBox>
                    </Grid>
                </WrapPanel>
            
            </WrapPanel>
            <WrapPanel  Margin="10"  Visibility="Collapsed">
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=Customer company:}}" ></TextBlock>
                    <TextBox Grid.Column="1"   BorderBrush="Black" FontSize="18"  Text="{Binding CHAR4}" Width="200" ></TextBox>
                </Grid>
                <Grid  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=R1:}}" ></TextBlock>
                    <TextBox Grid.Column="1" Name="txtR1" Text="{Binding NUMBER1}" BorderBrush="Black" FontSize="18" Width="50" ></TextBox>
                </Grid>
                <Grid  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=R2:}}" ></TextBlock>
                    <TextBox Grid.Column="1" Name="txtR2" Text="{Binding NUMBER2}" BorderBrush="Black"   FontSize="18"  Width="50" ></TextBox>
                </Grid>
            </WrapPanel>
            <Grid Margin="10">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="18" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=Customer Remark(then Enter):}}"></TextBlock>
                <TextBox   FontSize="18" Grid.Column="1" Name="txtRemark" Height="50" Width="800"   TextWrapping="Wrap"
                                 KeyUp="txtRemark_KeyUp" 
                                   Text="{Binding Path=REMARK}" Margin="1,0,0,0"/>
            </Grid>
            <WrapPanel Margin="10">
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="200"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock FontSize="18" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=Article: Input and Enter}}"></TextBlock>
                    <ex:TXT72  FontSize="18" Grid.Column="1"  CharacterCasing="Upper" KeyUp="txtNArt_KeyUp" 
                               Name="txtNart"
                               IsAutoEnter="False" Text="{Binding ART,ElementName=TV}"
                               Width="200" MaxLength="50" ></ex:TXT72>
                </Grid>
                <Grid  Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"></ColumnDefinition>
                        <ColumnDefinition Width="200"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  FontSize="18" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=Color:}}"></TextBlock>
                    <TextBox  FontSize="18" Grid.Column="1"   Width="200" Text="{Binding Path=VKPFARBE}"></TextBox>
                </Grid>
                <Grid  Visibility="Collapsed"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="200"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  FontSize="18" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=ExhPrice:}}"></TextBlock>
                    <TextBox  FontSize="18" Grid.Column="1"  Text="{Binding SPRICE}" Width="200"></TextBox>
                    <!--TextBox  FontSize="18" Grid.Column="2" Name="txtUM"  Visibility="Collapsed" Text="{Binding CHAR1, Source={StaticResource ResourceKey=vwTVKP}}" Width="200"></TextBox-->
                </Grid>
            </WrapPanel>
            
        </StackPanel>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <WrapPanel  >
                <Button Grid.Column="1"   Margin="20,0,0,0"  Width="40" Height="40" Click="DeleteCommand"  >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/remove.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
            <DataGrid  Grid.Row="1"  VerticalAlignment="Top"  
                                   AutoGenerateColumns="False"
                                   EnableRowVirtualization="False"
                                   VerticalScrollBarVisibility="Auto"
                                   HorizontalScrollBarVisibility="Auto"
                                   HeadersVisibility="Column"     
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                                   x:Name="dlgMaster"  
                                    Grid.ColumnSpan="2" Margin="0,0.2,0.2,0"
                    >
                <DataGrid.Columns> 
                    <DataGridTextColumn Binding="{Binding Path=CUSTOMER}" Header="Brand"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ROWNID}" Header="ROWNID"  Width="Auto" /> 
                    <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="BarCode"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VKPARTDES}" Header="Article NO"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=REMARK}" Header="Customer Remark"  Width="Auto" /> 
                    <DataGridTextColumn Binding="{Binding Path=COMPOSITION}" Header="Composition"  Width="Auto" /> 
                    <DataGridTextColumn Binding="{Binding Path=TWIDTH,Converter={StaticResource gb2312}}" Header="Width"  Width="Auto" /> 
                    <DataGridTextColumn Binding="{Binding Path=GSQM}" Header="Weight"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VKPCDES}" Header="Remark"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=PRICE}" Header="Customerprice"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=CHAR1}" Header="Code"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=CHAR2}" Header="Book"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=CHAR3}" Header="Location"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=CHAR4}" Header="Supplier"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=CHAR5}" Header="Buyer Name"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid  >
        </Grid>
    </Grid>
</me:UIEXORD> 
 
